const {ccclass, property} = cc._decorator;

@ccclass
export default class New_Label extends cc.Component {

    /*
    挂载本脚本的节点在游戏开始时会不断向上飞
    */

    @property({displayName: "速度", tooltip: "速度", type: cc.Float})
    speed: number = 300;

    start () {
        let self = this;

        // 20秒后销毁
        this.scheduleOnce(function () {
            self.node.destroy();
        }, 20);
    }

    update (dt: number) {
        // 不断向上飞
        this.node.y += dt * this.speed;
    }

}
